﻿Namespace EIBData.Enums
    Public Module EIBData_Date

        Public Enum EIBData_Days As Byte
            NoDay = 0
            Monday = 1
            Tuesday = 2
            Wednesday = 3
            Thursday = 4
            Friday = 5
            Saturday = 6
            Sunday = 7
        End Enum

        Public Function DayOfWeekToDay(dof As DayOfWeek) As EIBData_Days
            Select Case dof
                Case DayOfWeek.Monday
                    Return EIBData_Days.Monday
                Case DayOfWeek.Tuesday
                    Return EIBData_Days.Tuesday
                Case DayOfWeek.Wednesday
                    Return EIBData_Days.Wednesday
                Case DayOfWeek.Thursday
                    Return EIBData_Days.Thursday
                Case DayOfWeek.Friday
                    Return EIBData_Days.Friday
                Case DayOfWeek.Saturday
                    Return EIBData_Days.Saturday
                Case DayOfWeek.Sunday
                    Return EIBData_Days.Sunday
                Case Else
                    Return EIBData_Days.NoDay
            End Select
        End Function

        Public Function DayToDayOfWeek(day As EIBData_Days) As DayOfWeek
            Select Case day
                Case EIBData_Days.Monday
                    Return DayOfWeek.Monday
                Case EIBData_Days.Tuesday
                    Return DayOfWeek.Tuesday
                Case EIBData_Days.Wednesday
                    Return DayOfWeek.Wednesday
                Case EIBData_Days.Thursday
                    Return DayOfWeek.Thursday
                Case EIBData_Days.Friday
                    Return DayOfWeek.Friday
                Case EIBData_Days.Saturday
                    Return DayOfWeek.Saturday
                Case EIBData_Days.Sunday
                    Return DayOfWeek.Sunday
                Case Else
                    Return -1
            End Select
        End Function


        Public Enum EIBData_DateFault
            No_Fault = 0
            Fault = 1
        End Enum

        Public Enum EIBData_WorkingDay
            No_working_day = 0
            Working_day = 1
        End Enum

        Public Enum EIBData_Valid
            Valid = 0
            Invalid = 1
        End Enum

        Public Enum EIBData_Time
            standard_time = 0
            summer_daylight_saving_time = 1
        End Enum

        Public Enum EIBData_ClockQuality
            wo_ext__sync = 0
            w_ext_sync = 1
        End Enum
    End Module
End Namespace